<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>编辑菜品信息</title>
    <link rel="stylesheet" type="text/css" href="/project/css/query.css" />
    <script type="text/javascript" src="/project/js/jquery-3.2.1.js"></script>
    <script type="text/javascript">
        $(function(){
            var params = new URLSearchParams(window.location.search);
            var dishesId = params.get("dishesId");
            if(dishesId!=null && dishesId!="null"){
                var url="/dishes20250327/queryById.category";
                var param = {
                    "dishesId":dishesId
                };
                $.get(url,param,function(data){
                    var jsonObj = JSON.parse(data);
                    $("#dishesId").val(jsonObj.dishesId);
                    $("#dishesName").val(jsonObj.dishesName);
                    $("#price").val(jsonObj.price);
                    $("#description").val(jsonObj.description);
                })
            }

        })
    </script>
</head>
<body>
<div id="top">·当前位置： 菜品管理 -- 编辑菜品信息</div>
<form action="/project/addOrUpdate.category" method="post">
    <table id="tab" style="margin-top: 30px; border-collapse:separate; border-spacing:0px 10px;">
        <tr>
            <td align="right">菜品ID : </td>
            <td align="left">&nbsp;<input type="text" id="dishesId" placeholder="新增无需填写" readonly="readonly" name="dishesId"/></td>
        </tr>
        <tr>
            <td align="right" style="width:40%;">菜品名称 : </td>
            <td align="left">&nbsp;<input type="text" id="dishesName" name="dishesName"/><span
                    style="color: red"> *</span><span id="message0" style="color: red;" class="message"></span></td>
        </tr>
        <tr>
            <td align="right">价格 : </td>
            <td align="left">&nbsp;<input type="text" id="price" name="price"/><span
                    style="color: red"> *</span><span id="message1" style="color: red;" class="message"></span></td>
        </tr>
        <tr>
            <td align="right">菜品描述 : </td>
            <td align="left">&nbsp;<textarea id="description" name="description"></textarea><span
                    style="color: red"> *</span><span id="message2" style="color: red;" class="message"></span></td>
        </tr>
        <tr>
            <td colspan="2"><input style="width: 60px;" type="submit" id="submit"
                                   value="提交" /></td>
        </tr>
    </table>
</form>
</body>
</html>